package cn.nlsde.util;

import cn.nlsde.entity.Evaluation;
import org.apache.commons.math3.distribution.NormalDistribution;

/**
 * Created by zwj on 2016/10/8.
 */
public class NormUtils {

    /**
     * 计算每个的权重
     *
     * @param evaluation
     */

    public static double cumulativeProbability(double score, Evaluation evaluation) {
        if (evaluation == null) {
            return 0.;
        }
        NormalDistribution norm = new NormalDistribution(evaluation.getMean()
                , evaluation.getVariance());
        return norm.cumulativeProbability(score);
    }
}
